package com.zone.lib.download.enums;

/**
 * @Author: pkqlqx
 * @CreateDate: 2022/1/2 20:00
 * @Description:
 */
public enum AppActionEnum {

    DOWNLOAD_CONTINUE(11, "DOWNLOAD_CONTINUE","暂停继续"),
    DOWNLOAD_WAIT(12, "DOWNLOAD_WAIT","等待下载"),
    DOWNLOAD_PREPARE(13, "DOWNLOAD_PREPARE","下载中"),
    DOWNLOAD_PAUSE(15, "DOWNLOAD_PAUSE","继续"),
    DOWNLOAD_DELETE(18, "DOWNLOAD_DELETE","下载"),

    INSTALL_WAIT(22, "INSTALL_WAIT","等待安装"),
    INSTALL_PAUSE(25, "INSTALL_PAUSE","继续"),

    UNINSTALL_APP_AND_LIGHT(30, "UNINSTALL_APP_AND_LIGHT","卸载"),
    UNINSTALL_APP(31, "UNINSTALL_APP","卸载"),

    LIGHT_INSTALL(40, "LIGHT_INSTALL","安装"),
    LIGHT_OPEN(41, "LIGHT_OPEN","进入"),
    LIGHT_DELETE(42, "LIGHT_DELETE","快应用删除"),

    UPDATE(50, "UPDATE","更新中"),
    REFRESH_TASK(60, "REFRESH_TASK","刷新任务队列"),
    ;
    public int CODE;
    public String NAME;
    public String TITLE;

    AppActionEnum(int code, String name, String title){
        this.CODE = code;
        this.NAME = name;
        this.TITLE = title;
    }

    public static AppActionEnum get(int code){
        switch (code){
            case 12:
                return DOWNLOAD_WAIT;
            case 13:
                return DOWNLOAD_PREPARE;
            case 15:
                return DOWNLOAD_PAUSE;
            case 18:
                return DOWNLOAD_DELETE;
            case 22:
                return INSTALL_WAIT;
            case 25:
                return INSTALL_PAUSE;
            case 30:
                return UNINSTALL_APP;
            case 40:
                return LIGHT_INSTALL;
            case 41:
                return LIGHT_OPEN;
            case 42:
                return LIGHT_DELETE;
            case 50:
                return UPDATE;
            case 60:
                return REFRESH_TASK;
        }
        return null;
    }

}
